<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
	    <base href="<%=basePath%>">
		<title>我的订单</title>
        <%@include file="../collect/meta.jsp"%>
		<link rel="stylesheet" href="css/radius.css" type="text/css"></link>
		<link rel="stylesheet" href="css/table.css" type="text/css"></link>
		<script type="text/javascript" src="${ctx}/js/returnTop.js"></script>
  </head>
	<body lang="zh-cn">
		<div class="wrapper">	
	        <c:import url="/collect/top.jsp"></c:import>
			<div class="main-container" id="main-container">
				<div class="main-container-inner">
					<c:import url="/collect/left.jsp"></c:import>
					<div class="main-content">
						<div class="breadcrumbs" id="breadcrumbs">
							<ul class="breadcrumb">
								<li><i class="icon-home home-icon"></i>商城</li>
								<li>我的订单</li>
							</ul><!-- .breadcrumb -->
						</div>
						<div class="page-content">
							<div class="row">
								<div class="col-xs-12">
									<table class="table table-striped table-bordered table-hover">
										 <tr>
										   <th>商品标题</th>
										   <th>金额</th>
										   <th>数量</th>
										   <th>生效时间</th>
										   <th>过期时间</th>
										   <th>状态</th>
										   <th>创建时间</th>
										 </tr>
										 <c:forEach items="${orderInfos}" var="orderInfo" varStatus="status">
											 <tr>
											   <td>${orderInfo.goodsName }</td>
											   <td>${orderInfo.tradeAmount }</td>
											   <td>${orderInfo.amount }</td>
											   <td>
											   		<c:choose>
											   			<c:when test="${not empty orderInfo.amount && orderInfo.amount != 0 }">
											   				/
											   			</c:when>
											   			<c:otherwise>
											   				${fn:substring(orderInfo.beginDate, 0, fn:indexOf(orderInfo.beginDate, '.'))}
											   			</c:otherwise>
											   		</c:choose>
											       </div>
											   </td>
											   <td>
											   		<c:choose>
											   			<c:when test="${not empty orderInfo.amount && orderInfo.amount != 0 }">
											   				/
											   			</c:when>
											   			<c:otherwise>
											   				${fn:substring(orderInfo.beginDate, 0, fn:indexOf(orderInfo.beginDate, '.'))}
											   			</c:otherwise>
											   		</c:choose>
											   </td>
											   <td>
											   		<c:choose>
											   			<c:when test="${orderInfo.status == 0 }">
											   				<a class="btn btn-xs btn-primary radius" href="tradeinfoaction!useAlipayToPay?orderInfo.orderId=${orderInfo.orderId}" target="_blank">支付</a>
											   				<a class="btn btn-xs btn-primary radius" href="orderInfoaction!delMyOrderInfo?orderInfo.orderId=${orderInfo.orderId}">删除</a>
											   			</c:when>
											   			<c:when test="${orderInfo.status == 1 }">已支付</c:when>
											   		</c:choose>
											   </td>
											   <td>${fn:substring(orderInfo.createDate, 0, fn:indexOf(orderInfo.createDate, '.'))}</td>
											 </tr>
										 </c:forEach>
									</table>			
								</div><!-- /.col -->
							</div><!-- /.row -->
						</div><!-- /.page-content -->
					</div><!-- /.main-content -->
				</div><!-- /.main-container-inner -->
				<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse" style="position:fixed;bottom:0;">
					<i class="icon-double-angle-up icon-only bigger-110"></i>
				</a>
			</div><!-- /.main-container -->
			<div class="push"></div>
	     </div>
	    <c:import url="/collect/down.jsp"></c:import>
	    
	    <script type="text/javascript">
	    	//防dropmenu刷新收回;查看回复：$设置回复
			$(document).ready(function(){
				$('.zfb > ul').show();
				$('.zfb > ul > li a').eq(1).css("color","red");
			});
	    </script>
  </body>
</html>
